//
//  WmcInvalidation.swift
//  YPWatermarkCamera
//
//  Created by yupao_ios_macmini06 on 2022/10/24.
//

import Foundation
import NSObject_Rx
import RxRelay
import RxSwift
import UIKit
/// 错误类型
enum WmcInputError: Error {
    /// 无效手机
    case phoneNotValid
    /// 输入位数超过15字符
    case lengthExcceed15
    /// 输入位数超过11字符
    case lengthExcceed11
    /// 描述
    var description: String {
        switch self {
        case .phoneNotValid:
            return "请输入正确的手机号"
        case .lengthExcceed15:
            return "最多输入15位字符"
        case .lengthExcceed11:
            return "最多输入11位字符"
        }
    }
}

/// 验证协议
protocol WmcInputValidator {
    func validate(input: UITextField) throws -> Bool
}
